home *** CD-ROM | disk | FTP | other *** search
/ boe.pres.k12.wv.us / boe.pres.k12.wv.us.zip / boe.pres.k12.wv.us / Utilities / Xerox Workcentre 5335 / Windows Scan / 64-bit_x64 / Russian / cpsimage.cab / data / sys / xipxml.elf < prev    next >
Text File  |  2009-04-23  |  29KB  |  603 lines

  1. /*
  2. ** $Id: xipxml.elf,v 1.12 2008/03/05 17:47:40 campanel Exp $
  3. */
  4.  
  5.  
  6. /******************************************************************************/
  7. /*
  8. ** This class provides access to a node list. A node list is an ordered set of
  9. ** nodes accessable by index.
  10. */
  11. /* @getLength Returns the number of nodes in the node set. */
  12. /* @item Returns a node given by the index. */
  13. /* @owner Private field. */
  14. /* @handle Private field. */
  15. /******************************************************************************/
  16. CLASS XmlNodeList {
  17.     METHOD getLength() RETURNS( INTEGER type ) NATIVE "XMLNodeListMethods@xipxml";
  18.     METHOD item( INTEGER index ) RETURNS( XmlNode node ) NATIVE "XMLNodeListMethods@xipxml";
  19.  
  20.     // Private
  21.     XmlNode owner;
  22.     VOID handle;
  23. }
  24.  
  25.  
  26. /******************************************************************************/
  27. /*
  28. ** This class provides access to a named node map. This map is not ordered but
  29. ** can be accessed by index for convience.
  30. */
  31. /* @getLength Returns the number of nodes in the node set. */
  32. /* @item Returns a node given by the index. */
  33. /* @getNamedItem Returns a node by the name given. */
  34. /* @getNamedItemNS Returns a node by name given with the namespace specified. */
  35. /* @removeNamedItem Removes and returns a node by the name given. */
  36. /* @removeNamedItemNS Removes and returns a node by name given with the namespace specified. */
  37. /* @setNamedItem Adds a node using its name. Returns a replaced node. */
  38. /* @setNamedItemNS Adds a node by its name and namespace. Returns a replaced node. */
  39. /* @owner Private field. */
  40. /* @handle Private field. */
  41. /******************************************************************************/
  42. CLASS XmlNamedNodeMap {
  43.     METHOD getLength() RETURNS( INTEGER type ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  44.     METHOD item( INTEGER index ) RETURNS( XmlNode node ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  45.     METHOD getNamedItem( STRING name ) RETURNS( XmlNode node ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  46.     METHOD getNamedItemNS( STRING ns, STRING name ) RETURNS( XmlNode node ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  47.  
  48.     METHOD removeNamedItem( STRING name ) RETURNS( XmlNode node ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  49.     METHOD removeNamedItemNS( STRING ns, STRING name ) RETURNS( XmlNode node ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  50.     METHOD setNamedItem( XmlNode node ) RETURNS( XmlNode node ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  51.     METHOD setNamedItemNS( XmlNode node ) RETURNS( XmlNode node ) NATIVE "XMLNamedNodeMapMethods@xipxml";
  52.  
  53.     // Private
  54.     XmlNode owner;
  55.     VOID handle;
  56. }
  57.  
  58.  
  59. /******************************************************************************/
  60. /*
  61. ** This class provides access to the general node interface. All nodes in the
  62. ** DOM are XmlNodes but can be typed cast to the actual node if needed.
  63. */
  64. /* @getNodeName Returns the node name. */
  65. /* @getNodeValue Returns the node value. */
  66. /* @getNodeType Returns the node type. The types are defined in XmlNode. */
  67. /* @setNodeName Sets the node name. */
  68. /* @setNodeValue Sets the node value. */
  69. /* @hasAttributes Returns true if there are attribute nodes. */
  70. /* @getAttributes Returns an XmlNamedNodeMap of the attribute nodes. */
  71. /* @hasChildren Returns true if there are child nodes. */
  72. /* @getChildNodes Returns an XmlNodeList of the child nodes. */
  73. /* @getFirstChild Returns the first child node. */
  74. /* @getLastChild Returns the last child node. */
  75. /* @getPreviousSibling Returns the previous sibling node. */
  76. /* @getNextSibling Returns the next sibling node. */
  77. /* @getParentNode Returns the parent node. */
  78. /* @getOwnerDocument Returns the XmlDocument this node belongs to. */
  79. /* @appendChild Adds a child node. */
  80. /* @insertBefore Adds a child before another child node. */
  81. /* @removeChild Removes a child node. */
  82. /* @replaceChild Replaces a child node with another. */
  83. /* @prependSibling Adds a sibling before this node. */
  84. /* @Free Frees all resources used by the node. */
  85. /* @Empty Does this contain a valid node. */
  86. /* @owner Private field. */
  87. /* @handle Private field. */
  88. /* @unlinked Private field. */
  89. /* @libref Private field. */
  90. /******************************************************************************/
  91. CLASS XmlNode {
  92.     // Constants
  93.     INTEGER XML_ELEMENT_NODE           = 1;
  94.     INTEGER XML_ATTRIBUTE_NODE         = 2;
  95.     INTEGER XML_TEXT_NODE              = 3;
  96.     INTEGER XML_CDATA_SECTION_NODE     = 4;
  97.     INTEGER XML_ENTITY_REF_NODE        = 5;
  98.     INTEGER XML_ENTITY_NODE            = 6;
  99.     INTEGER XML_PI_NODE                = 7;
  100.     INTEGER XML_COMMENT_NODE           = 8;
  101.     INTEGER XML_DOCUMENT_NODE          = 9;
  102.     INTEGER XML_DOCUMENT_TYPE_NODE     = 10;
  103.     INTEGER XML_DOCUMENT_FRAG_NODE     = 11;
  104.     INTEGER XML_NOTATION_NODE          = 12;
  105.     INTEGER XML_HTML_DOCUMENT_NODE     = 13;
  106.     INTEGER XML_DTD_NODE               = 14;
  107.     INTEGER XML_ELEMENT_DECL           = 15;
  108.     INTEGER XML_ATTRIBUTE_DECL         = 16;
  109.     INTEGER XML_ENTITY_DECL            = 17;
  110.     INTEGER XML_NAMESPACE_DECL         = 18;
  111.     INTEGER XML_XINCLUDE_START         = 19;
  112.     INTEGER XML_XINCLUDE_END           = 20;
  113.  
  114.     // Value methods
  115.     METHOD getNodeName() RETURNS( STRING name ) NATIVE "XMLNodeMethods@xipxml";
  116.     METHOD getNodeValue() RETURNS( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  117.     METHOD getNodeType() RETURNS( INTEGER type ) NATIVE "XMLNodeMethods@xipxml";
  118.  
  119.     METHOD setNodeName( STRING name ) NATIVE "XMLNodeMethods@xipxml";
  120.     METHOD setNodeValue( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  121.  
  122.     // Attributes, for ELEMENT nodes only
  123.     METHOD hasAttributes() RETURNS( ELFBOOLEAN has ) NATIVE "XMLNodeMethods@xipxml";
  124.     METHOD getAttributes() RETURNS( XmlNamedNodeMap map ) NATIVE "XMLNodeMethods@xipxml";
  125.  
  126.     // Child node methods
  127.     METHOD hasChildren() RETURNS( ELFBOOLEAN has ) NATIVE "XMLNodeMethods@xipxml";
  128.     METHOD getChildNodes() RETURNS( XmlNodeList list ) NATIVE "XMLNodeMethods@xipxml";
  129.     METHOD getFirstChild() RETURNS( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  130.     METHOD getLastChild() RETURNS( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  131.     METHOD getPreviousSibling() RETURNS( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  132.     METHOD getNextSibling() RETURNS( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  133.     METHOD getParentNode() RETURNS( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  134.     METHOD getOwnerDocument() RETURNS( XmlDocument doc ) NATIVE "XMLNodeMethods@xipxml";
  135.  
  136.     METHOD appendChild( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  137.     METHOD insertBefore( XmlNode newchild, XmlNode refchild ) NATIVE "XMLNodeMethods@xipxml";
  138.     METHOD removeChild( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  139.     METHOD replaceChild( XmlNode newchild, XmlNode oldchild ) NATIVE "XMLNodeMethods@xipxml";
  140.  
  141.     METHOD prependSibling( XmlNode node ) NATIVE "XMLNodeMethods@xipxml";
  142.  
  143.     METHOD Free() NATIVE "XMLNodeMethods@xipxml";
  144.     METHOD Empty() RETURNS( INTEGER empty ) NATIVE "XMLNodeMethods@xipxml";
  145.  
  146.     // Private
  147.     XmlNode owner;
  148.     VOID handle;
  149.     VOID unlinked;
  150.     XmlLib libref;
  151. }
  152.  
  153.  
  154. /******************************************************************************/
  155. /*
  156. ** This is the Element class. It inherits from the XmlNode class.
  157. */
  158. /* @getAttribute Returns the value of the attribute as a string. Character and general entity references are replaced with their values. */
  159. /* @getAttributeNode Returns the XmlAttr node for the given attribute. */
  160. /* @getAttributeNS Returns the value of the attribute as a string with the namespace given. Character and general entity references are replaced with their values. */
  161. /* @getAttributeNodeNS Returns the XmlAttr node for the given attribute with the namespace given. */
  162. /* @hasAttribute Returns true if the atttribute given exists. */
  163. /* @hasAttributeNS Returns true if the atttribute with the given namespace exists. */
  164. /* @getTagName Returns the element tag name. */
  165. /* @removeAttribute Removes an attribute by name. */
  166. /* @removeAttributeNS Removes an attribute by name and namespace. */
  167. /* @removeAttributeNode Removes an attribute node. */
  168. /* @setAttribute Adds, and replaces, an attribute by name. */
  169. /* @setAttributeNS Adds, and replaces, an attribute by name and namespace. */
  170. /* @setAttributeNode Adds, and replaces, an attribute node. */
  171. /* @setAttributeNodeNS Adds, and replaces, an attribute node. */
  172. /******************************************************************************/
  173. CLASS XmlElement EXTENDS XmlNode {
  174.     METHOD getTagName() RETURNS( STRING name ) NATIVE "XMLNodeMethods@xipxml";
  175.  
  176.     METHOD getAttribute( STRING name ) RETURNS( STRING value ) NATIVE "XMLElementMethods@xipxml";
  177.     METHOD getAttributeNode( STRING name ) RETURNS( XmlAttr node ) NATIVE "XMLElementMethods@xipxml";
  178.     METHOD getAttributeNS( STRING ns, STRING name ) RETURNS( STRING value ) NATIVE "XMLElementMethods@xipxml";
  179.     METHOD getAttributeNodeNS( STRING ns, STRING name ) RETURNS( XmlAttr node ) NATIVE "XMLElementMethods@xipxml";
  180.     METHOD hasAttribute( STRING name ) RETURNS( ELFBOOLEAN has ) NATIVE "XMLElementMethods@xipxml";
  181.     METHOD hasAttributeNS( STRING ns, STRING name ) RETURNS( ELFBOOLEAN has ) NATIVE "XMLElementMethods@xipxml";
  182.  
  183.     METHOD removeAttribute( STRING name ) NATIVE "XMLElementMethods@xipxml";
  184.     METHOD removeAttributeNS( STRING ns, STRING name ) NATIVE "XMLElementMethods@xipxml";
  185.     METHOD removeAttributeNode( XmlAttr node ) NATIVE "XMLElementMethods@xipxml";
  186.     METHOD setAttribute( STRING name, STRING value ) NATIVE "XMLElementMethods@xipxml";
  187.     METHOD setAttributeNS( STRING ns, STRING name, STRING value ) NATIVE "XMLElementMethods@xipxml";
  188.     METHOD setAttributeNode( XmlAttr node ) NATIVE "XMLElementMethods@xipxml";
  189.     METHOD setAttributeNodeNS( XmlAttr node ) NATIVE "XMLElementMethods@xipxml";
  190. }
  191.  
  192.  
  193. /******************************************************************************/
  194. /*
  195. ** This is the Attr class. It inherits from the XmlNode class.
  196. */
  197. /* @getOwnerElement Returns the XmlElement this attribute belongs to. */
  198. /* @getName Returns the name of the attribute. */
  199. /* @getValue Returns the value of the attribute as a string.  Character and general entity references are replaced with their values. */
  200. /* @setData Sets the value of the attribute. */
  201. /******************************************************************************/
  202. CLASS XmlAttr EXTENDS XmlNode {
  203.     METHOD getOwnerElement() RETURNS( XmlElement owner ) NATIVE "XMLNodeMethods@xipxml";
  204.     METHOD getName() RETURNS( STRING name ) NATIVE "XMLNodeMethods@xipxml";
  205.     METHOD getValue() RETURNS( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  206.  
  207.     METHOD setValue( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  208. }
  209.  
  210.  
  211. /******************************************************************************/
  212. /*
  213. ** This is the Text class. It inherits from the XmlNode class.
  214. */
  215. /* @getData Return the content of the text span. */
  216. /* @getLength Returns the content length. */
  217. /* @setData Sets the content. */
  218. /******************************************************************************/
  219. CLASS XmlText EXTENDS XmlNode {
  220.     METHOD getData() RETURNS( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  221.     METHOD getLength() RETURNS( INTEGER length ) NATIVE "XMLNodeMethods@xipxml";
  222.  
  223.     METHOD setData( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  224. }
  225.  
  226.  
  227. /******************************************************************************/
  228. /*
  229. ** This is the Comment class. It inherits from the XmlNode class.
  230. */
  231. /* @getData Return the content of the comment. */
  232. /* @getLength Returns the content length. */
  233. /* @setData Sets the content. */
  234. /******************************************************************************/
  235. CLASS XmlComment EXTENDS XmlNode {
  236.     METHOD getData() RETURNS( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  237.     METHOD getLength() RETURNS( INTEGER length ) NATIVE "XMLNodeMethods@xipxml";
  238.  
  239.     METHOD setData( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  240. }
  241.  
  242.  
  243. /******************************************************************************/
  244. /*
  245. ** This is the CDATASection class. It inherits from the XmlNode class.
  246. */
  247. /* @getData Return the content of the CDATA. */
  248. /* @getLength Returns the content length. */
  249. /* @setData Sets the content. */
  250. /******************************************************************************/
  251. CLASS XmlCDATASection EXTENDS XmlNode {
  252.     METHOD getData() RETURNS( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  253.     METHOD getLength() RETURNS( INTEGER length ) NATIVE "XMLNodeMethods@xipxml";
  254.  
  255.     METHOD setData( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  256. }
  257.  
  258.  
  259. /******************************************************************************/
  260. /*
  261. ** This is the ProcessingInstruction class. It inherits from the XmlNode class.
  262. */
  263. /* @getData Returns the content. This is from the first non white space character after the target. */
  264. /* @getTarget Returns the target. This is the first token of the PI. */
  265. /* @setData Sets the content. */
  266. /******************************************************************************/
  267. CLASS XmlProcessingInstruction EXTENDS XmlNode {
  268.     METHOD getData() RETURNS( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  269.     METHOD getTarget() RETURNS( STRING target ) NATIVE "XMLNodeMethods@xipxml";
  270.  
  271.     METHOD setData( STRING value ) NATIVE "XMLNodeMethods@xipxml";
  272. }
  273.  
  274.  
  275. /******************************************************************************/
  276. /*
  277. ** This is the Document Fragment class. It inherits from the XmlNode class.
  278. */
  279. /******************************************************************************/
  280. CLASS XmlDocumentFragment EXTENDS XmlNode {
  281.     // Needs at least one decl so just redefine one from the parent.
  282.     METHOD getNodeType() RETURNS( INTEGER type ) NATIVE "XMLNodeMethods@xipxml";
  283. }
  284.  
  285.  
  286. /******************************************************************************/
  287. /*
  288. ** This is the Entity Reference class. It inherits from the XmlNode class.
  289. */
  290. /******************************************************************************/
  291. CLASS XmlEntityReference EXTENDS XmlNode {
  292.     // Needs at least one decl so just redefine one from the parent.
  293.     METHOD getNodeType() RETURNS( INTEGER type ) NATIVE "XMLNodeMethods@xipxml";
  294. }
  295.  
  296.  
  297. /******************************************************************************/
  298. /*
  299. ** This is the Document node class. It inherits from the XmlNode class.
  300. */
  301. /* @getDocumentElement Returns the main XmlElement node. */
  302. /* @setDocumentElement Sets the main XmlElement node. */
  303. /* @getVersion Returns the XML version of the document. */
  304. /* @getEncoding Returns the encoding of the document. This is the external encoding, the internal encoding is UTF-8. */
  305. /* @getDocumentURI Returns the document URI. */
  306. /* @getStandalone Returns true if the XML document is standalone. */
  307. /* @createAttribute Creates a new attribute node. */
  308. /* @createAttributeNS Creates a new attribute node with a namespace. */
  309. /* @createCDATASection Creates a new CDATA Section node. */
  310. /* @createComment Creates a new comment node. */
  311. /* @createProcessingInstruction Creates a new PI node. */
  312. /* @createTextNode Creates a new text node. */
  313. /* @createDocumentFragment Creates a new document fragment node. */
  314. /* @createEntityReference Creates a new entity reference node. */
  315. /* @createElement Creates a new element node. */
  316. /* @createElementNS Creates a new element node with a namespace. */
  317. /* @dumpFile Writes the DOM to a file. */
  318. /* @dumpString Writes the DOM to a STRING. */
  319. /* @createXPath Creates a new XPath context. */
  320. /* @canonicalize Writes canonicalized image of the DOM to a STRING. If a XmlNodeSet is given, only nodes specified in the node set are included; Otherise, all nodes are included. */
  321. /******************************************************************************/
  322. CLASS XmlDocument EXTENDS XmlNode {
  323.     METHOD getDocumentElement() RETURNS( XmlElement node ) NATIVE "XMLDocMethods@xipxml";
  324.     METHOD setDocumentElement( XmlElement node ) RETURNS( XmlElement oldnode) NATIVE "XMLDocMethods@xipxml";
  325.     METHOD getVersion() RETURNS( STRING version ) NATIVE "XMLDocMethods@xipxml";
  326.     METHOD getEncoding() RETURNS( STRING encoding ) NATIVE "XMLDocMethods@xipxml";
  327.     METHOD getDocumentURI() RETURNS( STRING uri ) NATIVE "XMLDocMethods@xipxml";
  328.     METHOD getStandalone() RETURNS( ELFBOOLEAN standalone ) NATIVE "XMLDocMethods@xipxml";
  329.  
  330.     METHOD createAttribute( STRING name ) RETURNS( XmlAttr node ) NATIVE "XMLDocMethods@xipxml";
  331.     METHOD createAttributeNS( STRING ns, STRING name ) RETURNS( XmlAttr node ) NATIVE "XMLDocMethods@xipxml";
  332.     METHOD createCDATASection( STRING data ) RETURNS( XmlCDATASection node ) NATIVE "XMLDocMethods@xipxml";
  333.     METHOD createComment( STRING data ) RETURNS( XmlComment node ) NATIVE "XMLDocMethods@xipxml";
  334.     METHOD createProcessingInstruction( STRING target, STRING data ) RETURNS( XmlProcessingInstruction node ) NATIVE "XMLDocMethods@xipxml";
  335.     METHOD createTextNode( STRING data ) RETURNS( XmlText node ) NATIVE "XMLDocMethods@xipxml";
  336.     METHOD createDocumentFragment() RETURNS( XmlDocumentFragment node ) NATIVE "XMLDocMethods@xipxml";
  337.     METHOD createEntityReference( STRING name ) RETURNS( XmlEntityReference node ) NATIVE "XMLDocMethods@xipxml";
  338.     METHOD createElement( STRING name ) RETURNS( XmlElement node ) NATIVE "XMLDocMethods@xipxml";
  339.     METHOD createElementNS( STRING ns, STRING name ) RETURNS( XmlElement node ) NATIVE "XMLDocMethods@xipxml";
  340.  
  341.     METHOD dumpFile( STRING filename, STRING encoding, INTEGER format ) NATIVE "XMLDocMethods@xipxml";
  342.     METHOD dumpString( STRING encoding, INTEGER format ) RETURNS( STRING data ) NATIVE "XMLDocMethods@xipxml";
  343.  
  344.     METHOD createXPath() RETURNS( XPath xpath ) NATIVE "XMLDocMethods@xipxml";
  345.     METHOD canonicalize( XmlNodeSet nodes ) RETURNS( STRING data ) NATIVE "XMLDocMethods@xipxml";
  346. }
  347.  
  348.  
  349. /******************************************************************************/
  350. /*
  351. ** This class provides the context for parsing an XML document into a DOM.
  352. */
  353. /* @New Creates a new parsing context. */
  354. /* @Free Frees the parsing context. */
  355. /* @Empty Does this contain a valid parsing context. */
  356. /* @newDocument  Obtains a new instance of a XmlDocument to build a DOM tree with. */
  357. /* @parseFile This parses an XML file and returns an XmlDocument. */
  358. /* @parseString This parses a string containing XML and returns an XmlDocument. */
  359. /* @libref Private field. */
  360. /* @context Private field. */
  361. /******************************************************************************/
  362. CLASS XmlDocumentBuilder {
  363.     // Constants
  364.     INTEGER XML_PARSE_RECOVER   = 1; /* recover on errors */
  365.     INTEGER XML_PARSE_NOENT     = 2; /* substitute entities */
  366.     INTEGER XML_PARSE_DTDLOAD   = 4; /* load the external subset */
  367.     INTEGER XML_PARSE_DTDATTR   = 8; /* default DTD attributes */
  368.     INTEGER XML_PARSE_DTDVALID  = 16; /* validate with the DTD */
  369.     INTEGER XML_PARSE_NOERROR   = 32; /* suppress error reports */
  370.     INTEGER XML_PARSE_NOWARNING = 64; /* suppress warning reports */
  371.     INTEGER XML_PARSE_PEDANTIC  = 128; /* pedantic error reporting */
  372.     INTEGER XML_PARSE_NOBLANKS  = 256; /* remove blank nodes */
  373.  
  374.     METHOD useOptions( INTEGER opts ) NATIVE "XMLDocBuilderMethods@xipxml";
  375.  
  376.     METHOD newDocument( STRING version ) RETURNS( XmlDocument doc ) NATIVE "XMLDocBuilderMethods@xipxml";
  377.  
  378.     METHOD parseFile( STRING filename ) RETURNS( XmlDocument doc ) NATIVE "XMLDocBuilderMethods@xipxml";
  379.     METHOD parseString( STRING doc, STRING url ) RETURNS( XmlDocument doc ) NATIVE "XMLDocBuilderMethods@xipxml";
  380.  
  381.     METHOD New() NATIVE "XMLDocBuilderMethods@xipxml";
  382.     METHOD Free() NATIVE "XMLDocBuilderMethods@xipxml";
  383.     METHOD Empty() RETURNS( INTEGER empty ) NATIVE "XMLDocBuilderMethods@xipxml";
  384.  
  385.     // Private
  386.     VOID context;
  387.     XmlLib libref;
  388. }
  389.  
  390.  
  391. //
  392. // XPath related objects
  393. //
  394.  
  395.  
  396. /******************************************************************************/
  397. /*
  398. ** This class provides access to a node set. Node sets are traditionally
  399. ** returned by XPath evaluations or other similar operations.
  400. */
  401. /* @getLength Returns the number of nodes in the node set. */
  402. /* @item Returns a node given by the index. */
  403. /* @castToString Casts the node set into a STRING. */
  404. /* @casttoBoolean Casts the node set into a ELFBOOLEAN. */
  405. /* @castToNumber Casts the node set into a DOUBLE. */
  406. /* @Free Frees any resources used by the node set. */
  407. /* @Empty Does this contain a valid node set. */
  408. /* @owner Private field. */
  409. /* @handle Private field. */
  410. /******************************************************************************/
  411. CLASS XmlNodeSet {
  412.     METHOD getLength() RETURNS( INTEGER type ) NATIVE "XMLNodeSetMethods@xipxml";
  413.     METHOD item( INTEGER index ) RETURNS( XmlNode node ) NATIVE "XMLNodeSetMethods@xipxml";
  414.  
  415.     METHOD castToString() RETURNS( STRING value ) NATIVE "XMLNodeSetMethods@xipxml";
  416.     METHOD castToBoolean() RETURNS( ELFBOOLEAN value ) NATIVE "XMLNodeSetMethods@xipxml";
  417.     METHOD castToNumber() RETURNS( DOUBLE value ) NATIVE "XMLNodeSetMethods@xipxml";
  418.  
  419.     METHOD Free() NATIVE "XMLNodeSetMethods@xipxml";
  420.     METHOD Empty() RETURNS( INTEGER empty ) NATIVE "XMLNodeSetMethods@xipxml";
  421.  
  422.     // Private
  423.     XmlNode owner;
  424.     VOID handle;
  425. }
  426.  
  427.  
  428. /******************************************************************************/
  429. /*
  430. ** This class provides access to the XPath expressions context.
  431. */
  432. /* @Free This releases any resources used by the XPath expression context. */
  433. /* @Empty Does this contain a valid XPath context. */
  434. /* @evaluate This evaluates the XPath expression and returns the type requested. The types are defined in XPath. */
  435. /* @registerNs This registers a new namespace. If namespace name is not specified, the namespace is unregistered. */
  436. /* @compile This compiles an XPath expression and returns it. */
  437. /* @owner Private field. */
  438. /* @handle Private field. */
  439. /******************************************************************************/
  440. CLASS XPath {
  441.     // Constants
  442.     INTEGER XPATH_NODESET = 1;
  443.     INTEGER XPATH_STRING = 2;
  444.     INTEGER XPATH_NUMBER = 3;
  445.     INTEGER XPATH_BOOLEAN = 4;
  446.  
  447.     METHOD evaluate( STRING expr, INTEGER type ) RETURNS( ELFOBJECT obj ) NATIVE "XPathMethods@xipxml";
  448.     METHOD compile( STRING expr ) RETURNS( XPathExpr expr ) NATIVE "XPathMethods@xipxml";
  449.     METHOD registerNs( STRING prefix, STRING ns ) NATIVE "XPathMethods@xipxml";
  450.  
  451.     METHOD Free() NATIVE "XPathMethods@xipxml";
  452.     METHOD Empty() RETURNS( INTEGER empty ) NATIVE "XPathMethods@xipxml";
  453.  
  454.     // Private
  455.     XmlNode owner;
  456.     VOID handle;
  457. }
  458.  
  459.  
  460. /******************************************************************************/
  461. /*
  462. ** This class contains a compiled XPath expression. Pre-compiled expressions
  463. ** are useful for performance reasons.
  464. */
  465. /* @Free This releases any resources used by the compiled expression. */
  466. /* @Empty Does this contain a valid compiled expression. */
  467. /* @evaluate This evaluates the compiled expression against an XPath context and returns the type requested. The types are defined in XPath. */
  468. /* @libref Private field. */
  469. /* @handle Private field. */
  470. /******************************************************************************/
  471. CLASS XPathExpr {
  472.     METHOD evaluate( XPath xpath, INTEGER type ) RETURNS( ELFOBJECT obj ) NATIVE "XPathExprMethods@xipxml";
  473.  
  474.     METHOD Free() NATIVE "XPathExprMethods@xipxml";
  475.     METHOD Empty() RETURNS( INTEGER empty ) NATIVE "XPathExprMethods@xipxml";
  476.  
  477.     // Private
  478.     VOID handle;
  479.     XmlLib libref;
  480. }
  481.  
  482.  
  483. /******************************************************************************/
  484. private
  485. CLASS XmlSAXParser {
  486.     METHOD parseFile( STRING filename, XmlSAXHandler handler ) NATIVE "XMLParserMethods@xipxml";
  487. }
  488.  
  489.  
  490. /******************************************************************************/
  491. private
  492. CLASS XmlSAXLocator {
  493.     METHOD getPublicId() RETURNS( STRING value ) NATIVE "XMLLocatorMethods@xipxml";
  494.     METHOD getSystemId() RETURNS( STRING value ) NATIVE "XMLLocatorMethods@xipxml";
  495.     METHOD getLineNumber() RETURNS( INTEGER line ) NATIVE "XMLLocatorMethods@xipxml";
  496.     METHOD getColumnNumber() RETURNS( INTEGER column ) NATIVE "XMLLocatorMethods@xipxml";
  497.  
  498.     METHOD Empty() RETURNS( INTEGER empty ) NATIVE "XMLLocatorMethods@xipxml";
  499.  
  500.     // Private
  501.     VOID handle;
  502. }
  503.  
  504.  
  505. /******************************************************************************/
  506. private
  507. CLASS XmlSAXAttributes {
  508.     METHOD getIndex( STRING qName ) RETURNS( INTEGER index ) NATIVE "XMLAttributesMethods@xipxml";
  509.     METHOD getIndexByNS( STRING uri, STRING localName ) RETURNS( INTEGER index ) NATIVE "XMLAttributesMethods@xipxml";
  510.  
  511.     METHOD getLength() RETURNS( INTEGER length ) NATIVE "XMLAttrbiutesMethods@xipxml";
  512.  
  513.     METHOD getLocalName( INTEGER index ) RETURNS( STRING name ) NATIVE "XMLAttributesMethods@xipxml";
  514.     METHOD getQName( INTEGER index ) RETURNS( STRING name ) NATIVE "XMLAttributesMethods@xipxml";
  515.     METHOD getType( INTEGER index ) RETURNS( STRING name ) NATIVE "XMLAttributesMethods@xipxml";
  516.     METHOD getURI( INTEGER index ) RETURNS( STRING uri ) NATIVE "XMLAttributesMethods@xipxml";
  517.  
  518.     METHOD getTypeByName( STRING qName ) RETURNS( STRING name ) NATIVE "XMLAttributesMethods@xipxml";
  519.     METHOD getTypeByNS( STRING uri, STRING localName ) RETURNS( STRING name ) NATIVE "XMLAttributesMethods@xipxml";
  520.  
  521.     METHOD getValue( INTEGER index ) RETURNS( STRING value ) NATIVE "XMLAttributesMethods@xipxml";
  522.     METHOD getValueByName( STRING qName ) RETURNS( STRING value ) NATIVE "XMLAttributesMethods@xipxml";
  523.     METHOD getValueByNS( STRING uri, STRING localName ) RETURNS( STRING value ) NATIVE "XMLAttributesMethods@xipxml";
  524.  
  525.     METHOD Empty() RETURNS( INTEGER empty ) NATIVE "XMLAttributesMethods@xipxml";
  526.  
  527.     // Private
  528.     VOID handle;
  529. }
  530.  
  531.  
  532. /******************************************************************************/
  533. private
  534. CLASS XmlSAXHandler {
  535.     // Content Handler methods
  536.     METHOD setDocumentLocator( XmlSAXLocator locator ) {}
  537.     METHOD characters( STRING data ) {}
  538.     METHOD ignorableWhitespace( STRING data ) {}
  539.     METHOD processingInstruction( STRING target, STRING data ) {}
  540.     METHOD startDocument() {}
  541.     METHOD endDocument() {}
  542.     METHOD startElement( STRING uri, STRING localName, STRING qName, XmlSAXAttributes attributes ) {}
  543.     METHOD endElement( STRING uri, STRING localName, STRING qName ) {}
  544.     METHOD skippedEntity( STRING name ) {}
  545.     METHOD startPrefixMapping( STRING prefix, STRING uri ) {}
  546.     METHOD endPrefixMapping( STRING prefix ) {}
  547.  
  548.     // DTD Handler methods
  549.     METHOD notationDecl( STRING name, STRING publicId, STRING systemId ) {}
  550.     METHOD unparsedEntityDecl( STRING name, STRING publicId, STRING systemId, STRING notationName ) {}
  551.  
  552.     // Decl Handler methods
  553.     METHOD attributeDecl( STRING element, STRING name, INTEGER type, STRING default, STRING value ) {}
  554.     METHOD externalEntityDecl( STRING name, STRING publicId, STRING systemId ) {}
  555.     METHOD internalEntityDecl( STRING name, STRING value ) {}
  556.  
  557.     // Entity Resolver methods
  558.     METHOD resolveEntity( STRING publicId, STRING systemId ) RETURNS( ELFOBJECT source ) {}
  559.  
  560.     // Lexical Handler methods
  561.     METHOD comment( STRING data ) {}
  562.     METHOD startCDATA() {}
  563.     METHOD endCDATA() {}
  564.     METHOD startDTD( STRING name, STRING publicId, STRING systemId ) {}
  565.     METHOD endDTD() {}
  566.     METHOD startEntity( STRING name ) {}
  567.     METHOD endEntity() {}
  568.  
  569.     // Error and warning methods
  570.     METHOD error( STRING error ) {}
  571.     METHOD fatalError( STRING error ) {}
  572.     METHOD warning( STRING error ) {}
  573. }
  574.  
  575.  
  576. /******************************************************************************/
  577. /*
  578. ** The sole purpose of this class is to provide a reference counted usage on the
  579. ** libxml2 library. This is needed because the library needs to be init'd and
  580. ** cleaned up before and after being used. In reality this is done with two
  581. ** levels of reference counts, one is on instances of this object with one ELF
  582. ** state and the other is lower. So when this ones reference count goes to zero
  583. ** the lower level reference count gets decremented. The lower level one IS
  584. ** protected by locks since the multiple ELF states could span threads.
  585. */
  586. /* @New On creation this increments the global reference count on the xml
  587. library, which is protected with mutex locks, and will init the library
  588. when the count leaves zero. */
  589. /* @Free On deletion this decrements the global reference count on the xml
  590. library, which is protected with mutex locks, and will cleanup the library
  591. when the count reaches zero. */
  592. /* @Empty This method always returns false in order to indicate it contains
  593. valid data. */
  594. /******************************************************************************/
  595. CLASS XmlLib {
  596.     METHOD New() NATIVE "XMLLibMethods@xipxml";
  597.     METHOD Free() NATIVE "XMLLibMethods@xipxml";
  598.     METHOD Empty() RETURNS( ELFBOOLEAN empty ) NATIVE "XMLLibMethods@xipxml";
  599.  
  600.     // Private
  601.     VOID reserved;
  602. }
  603.